package com.sylar.happygps;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class UserCenterActivity extends Activity implements OnClickListener{

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		setContentView(R.layout.usercenter);
		
		Button btn_title_left = (Button) findViewById(R.id.btn_title_left);
		btn_title_left.setVisibility(View.VISIBLE);
		btn_title_left.setText(R.string.app_name);
		btn_title_left.setOnClickListener(this);
		
		TextView tv_title_name = (TextView) findViewById(R.id.tv_title_name);
		tv_title_name.setVisibility(View.VISIBLE);
		tv_title_name.setText("用户中心");
		
		View tv_userlogin = findViewById(R.id.tv_userlogin);
		tv_userlogin.setOnClickListener(this);
		View tv_contact = findViewById(R.id.tv_contact);
		tv_contact.setOnClickListener(this);
		View tv_email_setting = findViewById(R.id.tv_email_setting);
		tv_email_setting.setOnClickListener(this);
		View tv_register = findViewById(R.id.tv_register);
		tv_register.setOnClickListener(this);
		View tv_navsetting = findViewById(R.id.tv_navsetting);
		tv_navsetting.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.tv_userlogin:
			toUserLogin();
			break;
		case R.id.tv_contact:
			toUserContact();
			break;
		case R.id.tv_email_setting:
			toUserEmail();
			break;
		case R.id.tv_register:
			toUserRegister();
			break;
		case R.id.tv_navsetting:
			toUserNavSet();
			break;
		case R.id.btn_title_left:
			finish();
			break;
		}
	}
	
	private void toUserLogin(){
		Intent intent = new Intent(this,UserLoginActivity.class);
		startActivity(intent);
	}
	
	private void toUserEmail(){
		Intent intent = new Intent(this,UserEmailActivity.class);
		startActivity(intent);
	}
	
	private void toUserRegister(){
		Intent intent = new Intent(this,UserRegisterActivity.class);
		startActivity(intent);
	}
	
	private void toUserNavSet(){
		Intent intent = new Intent(this,UserNavSetActivity.class);
		startActivity(intent);
	}
	
	private void toUserContact(){
		Intent intent = new Intent(this,UserContaActivity.class);
		startActivity(intent);
	}
}
